package com.rst.model;

import java.sql.Date;
import java.sql.Time;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@Entity
@Table(name="t_exams")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class Exam {
	
	public static final int ACTIVE = 1;
	public static final int INACTIVE = 0;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="f_id")
	private Long id;	

	@Column(name="f_subject_id")
	private Long subjectId;
	
	@Column(name="f_start_time")
	private Time startTime;
	
	@Column(name="f_end_time")
	private Time endTime;

	@Column(name="f_minimum_marks")
	private Double minimumMarks;

	@Column(name="f_maximum_marks")
	private Double maximumMarks;

	@Column(name="f_status")
	private Integer status;

	@Column(name="f_created_at")
	private Date createdAt;
	
	@Column(name="f_updated_at")
	private Date updatedAt;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_subject_id", nullable=false, insertable=false, updatable=false)
	private Subject subject;

	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getSubjectId() {
		return subjectId;
	}

	public void setSubjectId(Long subjectId) {
		this.subjectId = subjectId;
	}


	public Time getStartTime() {
		return startTime;
	}

	public void setStartTime(Time startTime) {
		this.startTime = startTime;
	}

	public Time getEndTime() {
		return endTime;
	}

	public void setEndTime(Time endTime) {
		this.endTime = endTime;
	}

	public Double getMinimumMarks() {
		return minimumMarks;
	}

	public void setMinimumMarks(Double minimumMarks) {
		this.minimumMarks = minimumMarks;
	}

	public Double getMaximumMarks() {
		return maximumMarks;
	}

	public void setMaximumMarks(Double maximumMarks) {
		this.maximumMarks = maximumMarks;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}

	public Subject getSubject() {
		return subject;
	}

	public void setSubject(Subject subject) {
		this.subject = subject;
	}

	
}
